package com.tenbent.product.center.insures.bo;

import com.tenbent.product.base.bo.BizObject;
import com.tenbent.product.base.mybatis.annotations.TypeAlias;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;

/**
 * 产品实体
 *
 * @author Randy
 *
 *         Created by ThinkPad on 2017/8/21.
 */
@Entity
@Table(name = "pc_product")
@TypeAlias("product")
public class Product extends BizObject {

	/** 产品编码 **/
	@Column(name = "pd_code")
	private String pdCode;

	/** 产品名称 **/
	@Column(name = "pd_name")
	private String pdName;

	/** 产品状态(1 启用 2 停用) **/
	@Column
	private Integer status;

	/** 最小价格 **/
	@Column(name = "min_amount")
	private BigDecimal minAmount;

	/** 产品图片地址 **/
	@Column
	private String images;

	/** 产品分类ID **/
	@Column(name = "category_id")
	private Integer categoryId;

	/** 产品分类名称 **/
	@Column(name = "category_name")
	private String categoryName;

	/** 保险公司ID **/
	@Column(name = "insurer_id")
	private Integer insurerId;

	/** 保险公司名称 **/
	@Column(name = "insurer_name")
	private String insurerName;

	/** 出单类型(1 线上 2 线下) **/
	@Column(name = "out_type")
	private Integer outType;

	/** 产品描述 **/
	@Column(name = "description")
	private String desc;

	/** 产品备注 **/
	@Column
	private String remark;

	/** 产品扩展 **/
	@Column(name = "extend_info")
	private String extendInfo;

	public String getPdCode() {
		return pdCode;
	}

	public void setPdCode(String pdCode) {
		this.pdCode = pdCode;
	}

	public String getPdName() {
		return pdName;
	}

	public void setPdName(String pdName) {
		this.pdName = pdName;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public BigDecimal getMinAmount() {
		return minAmount;
	}

	public void setMinAmount(BigDecimal minAmount) {
		this.minAmount = minAmount;
	}

	public String getImages() {
		return images;
	}

	public void setImages(String images) {
		this.images = images;
	}

	public Integer getCategoryId() {
		return categoryId;
	}

	public void setCategoryId(Integer categoryId) {
		this.categoryId = categoryId;
	}

	public String getCategoryName() {
		return categoryName;
	}

	public void setCategoryName(String categoryName) {
		this.categoryName = categoryName;
	}

	public Integer getInsurerId() {
		return insurerId;
	}

	public void setInsurerId(Integer insurerId) {
		this.insurerId = insurerId;
	}

	public String getInsurerName() {
		return insurerName;
	}

	public void setInsurerName(String insurerName) {
		this.insurerName = insurerName;
	}

	public Integer getOutType() {
		return outType;
	}

	public void setOutType(Integer outType) {
		this.outType = outType;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getExtendInfo() {
		return extendInfo;
	}

	public void setExtendInfo(String extendInfo) {
		this.extendInfo = extendInfo;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o)
			return true;
		if (o == null || getClass() != o.getClass())
			return false;

		Product product = (Product) o;

		if (pdCode != null ? !pdCode.equals(product.pdCode) : product.pdCode != null)
			return false;
		if (pdName != null ? !pdName.equals(product.pdName) : product.pdName != null)
			return false;
		if (status != null ? !status.equals(product.status) : product.status != null)
			return false;
		if (minAmount != null ? !minAmount.equals(product.minAmount) : product.minAmount != null)
			return false;
		if (images != null ? !images.equals(product.images) : product.images != null)
			return false;
		if (categoryId != null ? !categoryId.equals(product.categoryId) : product.categoryId != null)
			return false;
		if (categoryName != null ? !categoryName.equals(product.categoryName) : product.categoryName != null)
			return false;
		if (insurerId != null ? !insurerId.equals(product.insurerId) : product.insurerId != null)
			return false;
		if (insurerName != null ? !insurerName.equals(product.insurerName) : product.insurerName != null)
			return false;
		if (outType != null ? !outType.equals(product.outType) : product.outType != null)
			return false;
		if (desc != null ? !desc.equals(product.desc) : product.desc != null)
			return false;
		if (remark != null ? !remark.equals(product.remark) : product.remark != null)
			return false;
		return extendInfo != null ? extendInfo.equals(product.extendInfo) : product.extendInfo == null;

	}

	@Override
	public int hashCode() {
		int result = pdCode != null ? pdCode.hashCode() : 0;
		result = 31 * result + (pdName != null ? pdName.hashCode() : 0);
		result = 31 * result + (status != null ? status.hashCode() : 0);
		result = 31 * result + (minAmount != null ? minAmount.hashCode() : 0);
		result = 31 * result + (images != null ? images.hashCode() : 0);
		result = 31 * result + (categoryId != null ? categoryId.hashCode() : 0);
		result = 31 * result + (categoryName != null ? categoryName.hashCode() : 0);
		result = 31 * result + (insurerId != null ? insurerId.hashCode() : 0);
		result = 31 * result + (insurerName != null ? insurerName.hashCode() : 0);
		result = 31 * result + (outType != null ? outType.hashCode() : 0);
		result = 31 * result + (desc != null ? desc.hashCode() : 0);
		result = 31 * result + (remark != null ? remark.hashCode() : 0);
		result = 31 * result + (extendInfo != null ? extendInfo.hashCode() : 0);
		return result;
	}

	@Override
	public String toString() {
		return "Product{" + "pdCode='" + pdCode + '\'' + ", pdName='" + pdName + '\'' + ", status=" + status
				+ ", minAmount=" + minAmount + ", images='" + images + '\'' + ", categoryId=" + categoryId
				+ ", categoryName='" + categoryName + '\'' + ", insurerId=" + insurerId + ", insurerName='"
				+ insurerName + '\'' + ", outType=" + outType + ", desc='" + desc + '\'' + ", remark='" + remark + '\''
				+ ", extendInfo='" + extendInfo + '\'' + '}';
	}
}
